﻿using System;
using System.Collections.Generic;

namespace Pixels.Logic.Rules
{
    class Power : LogicRule

    {
        internal override void execute() {

            var surplusPower = World.Colony.accumulatedResources[Resource.Power];

            // add surplus power to fence : 
            World.Colony.totalDefense += surplusPower / 2;

            // clear surplus power
            World.Colony.accumulatedResources.changeResource(Resource.Power, -surplusPower);
        }
    }
}
